import Vue from 'vue'
import Vuex from 'vuex'
import app from './modules/app'
import user from './modules/user'
import tree from './modules/tree'
import tagsView from './modules/tagsView'
import permission from './modules/permission'
import settings from './modules/settings'
import getters from './getters'

Vue.use(Vuex)

const store = new Vuex.Store({
  modules: {
    app,
    user,
    tree,
    tagsView,
    permission,
    settings
  },
  getters,
  state: {
    deptId: undefined,
    isKeepalive: undefined,
    programId: undefined,
    isnum:0,
    viewHeight:0,
	tableHeight:42,
	departmentRefresh:0
		
  },
  mutations: {
    updateCollapse (state, commit) {
      state.deptId = commit
    },
    updataeKeepalive (state, commit) {
      state.isKeepalive = commit
    },
    updateProgramPid (state, commit) {
      state.programId = commit
    },
    updateisNum (state, commit) {
      state.isnum = commit
    },
	updateTableHeight (state,commit) {
		state.tableHeight = commit
	},
	updateViewHeight (state, commit) {
      state.viewHeight = commit
    },
	// 添加部门时的部门刷新
	updateDepartment (state, commit) {
	  state.departmentRefresh = commit
	},
  }
})

export default store
